package com.aigc.sclassroom.utils;

import com.aigc.sclassroom.pojo.upStudent;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.builder.ExcelReaderBuilder;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

public class ExcelUtils {

    //导入街镇
    public static List<upStudent> parseExcel(InputStream inputStream) {
        List<upStudent> students = new ArrayList<>();

        ReadListener<upStudent> readListener = new upStudentReadListener(students);
        ExcelReaderBuilder read = EasyExcel.read(inputStream, upStudent.class, readListener);
        read.sheet().doRead();

        return students;
    }

}
